From 021c62163931e38331980cbba052c4ea69b520a3 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Tue, 14 Mar 2006 15:18:35 +0100 Subject: [PATCH] Initialise blkfront_info to zeroes after allocating it. Signed-off-by: Keir Fraser --- linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c index 5c73634c83..5e0b8be459 100644 --- a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c +++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c @@ -95,21 +95,17 @@ static int blkfront_probe(struct xenbus_device *dev, xenbus_dev_fatal(dev, -ENOMEM, "allocating info structure"); return -ENOMEM; } + + memset(info, 0, sizeof(*info)); info->xbdev = dev; info->vdevice = vdevice; info->connected = BLKIF_STATE_DISCONNECTED; - info->mi = NULL; - info->gd = NULL; INIT_WORK(&info->work, blkif_restart_queue, (void *)info); - info->shadow_free = 0; - memset(info->shadow, 0, sizeof(info->shadow)); for (i = 0; i < BLK_RING_SIZE; i++) info->shadow[i].req.id = i+1; info->shadow[BLK_RING_SIZE-1].req.id = 0x0fffffff; - info->users = 0; - /* Front end dir is a number, which is used as the id. */ info->handle = simple_strtoul(strrchr(dev->nodename,'/')+1, NULL, 0); dev->data = info; -- 2.30.2